﻿using System;
using System.Web.Mvc;

namespace EasyUIMvc
{
    public class LinkButtonExtension : ExtensionBase
    {
        private readonly LinkButtonSettings _settings;
        public LinkButtonExtension(LinkButtonSettings settings)
        {
            _settings = settings;
        }

        public override string GetScripts()
        {
            throw new NotImplementedException();
        }
        public override MvcHtmlString GetHtml()
        {
            var linkbutton = GetTopTag("a", "easyui-linkbutton", _settings);
            linkbutton.MergeAttribute("href", _settings.Href);
            linkbutton.SetInnerText(_settings.Text);
            return MvcHtmlString.Create(linkbutton.ToString());
        }
    }

    public class LinkButtonSettings : SettingsBase
    {
        public string Text { get; set; }
        public string Href { get; set; }
        public string Style { get; set; }
    }
}
